(ns jumpluff.state
  (:require [clojure.string :as s]))

(defonce channel-dataset (atom {}))
(defonce dataset-descriptions (atom {}))
(defonce server-emoji (atom {}))

(defonce csv-files (atom {}))
(defonce client (atom nil))

(defonce data-dir (or js/process.env.JUMPLUFF_DATA "data"))
(defonce config-file (or js/process.env.JUMPLUFF_CONFIG
                         "var/config.json"))

(def poi-query-prefixes
  (-> (or (not-empty js/process.env.JUMPLUFF_QUERY_PREFIX)
         "!poi ,p")
     s/trim
     (s/replace #"\s{2,}" " ")
     (s/split " ")))
